<template>
    <div>
        <p>{{ msg }}</p>
        <p>{{ user.username }}</p>
        <p>{{ product.productName }}</p>
        <hr>

        <button @click="loadUsername()">修改username</button>
    </div>
</template>

<script>
import { mapState,mapMutations,mapActions } from 'vuex'
export default {
    computed:{
        ...mapState(['msg','user','product'])
    },
    methods:{
        ...mapActions(['loadUsername'])
    }
}
</script>

<style>

</style>